<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-icon mui-icon-back mui-action-back mui-pull-left"></a>
			<h4 class="mui-title">我的文档</h4>
		</header>
		<div class="mui-content">
			<div class="mui-input-group" style="margin-top: 10px;">
				<ul id="divContent1" class="mui-table-view mui-table-view-striped mui-table-view-condensed">
					<li class="mui-table-view-cell">
			            <div class="mui-table">
			                <div id="123456" class="mui-table-cell mui-col-xs-12 mui-navigate-right" style="border: solid red 0px; ">
			                    <h5 class="mui-ellipsis-2" style="padding-top: 5px;">2019年5月份行政处罚案件信息公开</h5>
			                </div>
			            </div>
			      </li>
			    </ul>
				<ul id="divContent" class="mui-table-view mui-table-view-striped mui-table-view-condensed" v-for="item in readDocs">
			        <li class="mui-table-view-cell">
			            <div class="mui-table">
			                <div v-bind:id="item.Id" class="mui-table-cell mui-col-xs-12 mui-navigate-right" style="border: solid red 0px; " v-on:click="openChapter(item)">
			                    <h5 class="mui-ellipsis-2" style="padding-top: 5px;" v-html="item.Title">2019年5月份行政处罚案件信息公开</h5>
			                </div>
			            </div>
			        </li>
			    </ul>
			    
			</div>
		</div>
		<script src="../js/mui.min.js"></script>
		<script type="text/javascript" src="../js/vue.min.js" ></script>
		<script type="text/javascript" src="../js/app.js?v=20190610" ></script>
		<script type="text/javascript">
			mui.init( { gestureConfig:{
	            tap: true, //默认为true
	            doubletap: true, //默认为false
	            longtap: true, //默认为false
	            swipe: true, //默认为true
	            drag: true, //默认为true
	            hold:true,//默认为false，不监听
	            release:false//默认为false，不监听
	        }});
	        
			var vm = new Vue({
				el: '.mui-content',
				data: {
					readDocs:[],
				}
			});
			mui.plusReady(function(){
				/*读取用户阅读记录*/
				var docs = app.getDocuments();
				if(docs.ReadDocs != undefined){
					vm.readDocs = docs.ReadDocs;
				}
				
				// 使用mui的长按事件 我把我的复制元素 class 设置为copy-text
				mui('#divContent1').on('longtap', '.mui-table-cell', function () {
				    // 每次触发事件就会使用 innerText 获取纯文本。
				    var id = this.id;
				    console.log("Id="+id);
				    // 加了一个确认框 让用户选择是否复制
				    mui.confirm('确认移除所选内容？', '确认', ['取消','确定'], function (e) {
				    	if(e.index == 0)
				    		return;
				    	
				    	
				    })
				})
			});
			function openChapter(item){
				/*重新读取用户阅读信息，否则返回时，需要刷新已读取的内容*/
				var doc = app.getDocument(item.Id);
				
				mui.openWindow({
					id:"chapterInfo",
					url:"chapterInfo.html",
					show:{aniShow: 'pop-in'},
					extras: {refContentId: doc.Id,readIndex:doc.ReadIndex},
					waiting: {autoShow: true, /*自动显示等待框，默认为true*/}
				});
			}
		</script>
	</body>

</html>